<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
	<c:set var="path" value="${pageContext.request.contextPath }" />
		<div class="pageNav" >
				<b>共<span  class='text-primary'>${pageVo.pageCount}</span>页 当前 <span class='text-primary'>${pageVo.pageNow}</span>页</b>
				<%--上一页 --%>
				<c:choose>
					<c:when test="${pageVo.pageNow eq 1 }">
							<a class="pageNum">&lt;上一页</a>
					</c:when>
					<c:otherwise>
							<a href="${path}/${pageVo.url}&pageNow=${pageVo.pageNow-1 }" class="pageNum">&lt;上一页</a>
					</c:otherwise>
				</c:choose>
				<c:choose>
					<c:when test="${pageVo.pageCount <= 6 }">
						<c:set var="begin" value="1" />
						<c:set var="end" value="${pageVo.pageCount }" />
					</c:when>
					<c:otherwise>
						<c:set var="begin" value="${pageVo.pageNow-2 }" />
						<c:set var="end" value="${pageVo.pageNow + 3}" />
						<c:if test="${begin < 1 }">
							<c:set var="begin" value="1" />
							<c:set var="end" value="6" />
						</c:if>
						<c:if test="${end > pageVo.pageCount }">
							<c:set var="begin" value="${pageVo.pageCount-5 }" />
							<c:set var="end" value="${pageVo.pageCount }" />
						</c:if>
					</c:otherwise>
				</c:choose>

				<c:if test="${pageVo.pageNow >3 }">
					<a class="pageNum" href="${path}/${pageVo.url}&pageNow=1" >首页</a> 
				</c:if>


				<c:forEach begin="${begin }" end="${end }" var="i">
					<c:choose>
						<c:when test="${i eq pageVo.pageNow }">
							<b>${i }</b><!-- 当前页 -->
						</c:when>
						<c:otherwise>
						<a class="pageNum"   href="${path}/${pageVo.url}&pageNow=${i }">${i }</a>
						</c:otherwise>
					</c:choose>
				</c:forEach>
				<c:if test="${end < pageVo.pageCount }">
				<a class="pageNum" href="${path}/${pageVo.url}&pageNow=${pageVo.pageCount }" >尾页</a> 
				</c:if>
				<%--下一页 --%>
				<c:choose>
					<c:when test="${pageVo.pageNow eq pageVo.pageCount }">
							<a class="pageNum">下一页&gt;</a>
					</c:when>
					<c:otherwise>
						<a class="pageNum" href="${path}/${pageVo.url}&pageNow=${pageVo.pageNow+1 }">下一页&gt;</a>
					</c:otherwise>
				</c:choose>
</div>	